from fastapi import APIRouter
from pydantic import BaseModel
from datetime import date
from typing import List

shop = APIRouter()


class User(BaseModel):
    name: str
    age: int
    birth: date
    friends: List


@shop.post("/data",summary="数据校验")
async def create_user(user: User):
    return {"name":user.name, "age":user.age}


@shop.get('/list', summary='商品列表')
async def list():
    return {"message": "成功"}
